{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Linux平台编译线程池动态库二"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "gcc 12.3\n",
    "- /usr/include/c++/12/condition_variable: `class condition_variable`, `__condvar _M_cond`\n",
    "- /usr/include/c++/12/bits/std_mutex.h: `class __condvar`, `__gthread_cond_destroy`\n",
    "- https://github.com/gcc-mirror/gcc/blob/releases/gcc-12/libstdc%2B%2B-v3/include/std/condition_variable"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "vscode": {
     "languageId": "cpp"
    }
   },
   "outputs": [],
   "source": [
    "class condition_variable {\n",
    "  // ...\n",
    "  __condvar _M_cond;\n",
    "  // ...\n",
    "};"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "gcc 7\n",
    "- https://github.com/gcc-mirror/gcc/blob/releases/gcc-7/libstdc%2B%2B-v3/include/std/condition_variable"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "vscode": {
     "languageId": "cpp"
    }
   },
   "outputs": [],
   "source": [
    "class condition_variable {\n",
    "  // ...\n",
    "  #ifdef __GTHREAD_COND_INIT\n",
    "      __native_type\t\t\t_M_cond = __GTHREAD_COND_INIT;\n",
    "  #else\n",
    "      __native_type\t\t\t_M_cond;\n",
    "  #endif\n",
    "  // ...\n",
    "};"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "MSVC\n",
    "- https://github.com/microsoft/STL/blob/main/stl/inc/mutex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "vscode": {
     "languageId": "cpp"
    }
   },
   "outputs": [],
   "source": [
    "_EXPORT_STD class condition_variable {\n",
    "// ...\n",
    "private:\n",
    "    _Cnd_internal_imp_t _Cnd_storage{};\n",
    "// ...\n",
    "};"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "C++17",
   "language": "C++17",
   "name": "xcpp17"
  },
  "language_info": {
   "codemirror_mode": "text/x-c++src",
   "file_extension": ".cpp",
   "mimetype": "text/x-c++src",
   "name": "c++",
   "version": "17"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
